package com.cheejee.goodscenter.module.dto;

import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Length;

import com.cheejee.goodscenter.validated.InsertGroup;
import com.cheejee.goodscenter.validated.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author CARRY
 * @Date 2020年10月29日下午2:22:24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SpecificDto {

	@NotNull(message = "规格ID不能为空", groups = UpdateGroup.class)
	private Long id;

	@NotNull(message = "规格所属分类不能为空", groups = { UpdateGroup.class, InsertGroup.class })
	private Integer categoryId;

	@NotNull(message = "规格名不能为空", groups = { UpdateGroup.class, InsertGroup.class })
	@Length(max = 200, message = "规格名称长度不能超过200个字", groups = { InsertGroup.class, UpdateGroup.class })
	private String specificName;

	@NotEmpty(message = "规格值不能为空", groups = { UpdateGroup.class, InsertGroup.class })
	private List<@NotBlank(message = "规格值不能为空", groups = { UpdateGroup.class, InsertGroup.class }) @Length(max = 200, message = "规格值长度不能超过200个字", groups = { InsertGroup.class, UpdateGroup.class }) String> specificValue;
}
